/**
 * KoaWebSocketRouter
 */
class KoaWebSocketRouter {
    constructor() {
        this.routeList = {};
    }

    use(method, gen) {
        this.routeList[method] = gen;
        return this;
    }

    merge(prefix, routes) {
        for (const key of Object.keys(routes)) {
            this.use(`${prefix}:${key}`, routes[key]);
        }
        return this;
    }

    routes() {
        return this.routeList;
    }
}

export default KoaWebSocketRouter;
